// import { Router } from "express"
// import multer from "multer"
// import path from "path"
// import { IuploadOptions } from "./types"

// const upload = multer({ dest: '../uploads/' })

// class UploadFile {
//   upload(obj:IuploadOptions) {
//     upload(req, res, function (err:Error) {
//       if (err instanceof multer.MulterError) {
//         // 发生错误
//       } else if (err) {
//         // 发生错误
//       }
  
//       // 一切都好
//     })
//   }
// }

// export default new UploadFile() 

// export default (router: Router, _oracle: Ioracle, _callbackFn: IcallbackFn) => {
//   router.post('/upload', upload.single('avatar'), function (req, res) {
//     // req.file is the `avatar` file
//     // req.body will hold the text fields, if there were any
//     if(req.file?.originalname)
//     logger.info(path.parse(req.file?.originalname).ext)
//     logger.info(req.body)
//     //path.parse(req.file?.originalname).ext
//     res.send(JSON.stringify({
//       code: 200,
//       message: "success",
//       data: [],
//     }))
//   })

//   // router.post("/getFile",(req,res) => {

//   // })

//   return router
// }